<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<title>飞腾会-FitaClub</title>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
</head>
<!-- end header -->

<body>
  <div class="page-group">
    <div class="page page-current bg-light-gray" id="page-infinite-scroll-bottom">
      <header class="bar bar-nav fita-header">
        <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
        <a class="icon icon-menu pull-right open-panel"></a>
        <h1 class="title">提成明细</h1>
      </header>
      <div class="content profile-bill-content">
        <div class="bill-detail row no-gutter">
          <div class="col-100 name">${agent.name}</div>
          <div class="col-50">电话：${agent.mobile}</div>
          <div class="col-50">提成率： ${agent.company.primaryAgentRate}%</div>
          <div class="col-50">邮箱： ${agent.email}</div>
          <div class="col-50">订单金额：${agent.totalOrderMoneyAmount}元</div>
          <div class="col-50">累计提成： ${agent.totalCommission}元</div>
        </div>
        <div class="content-block-title" style="margin-left: .5rem; margin-right: .5rem;">订单明细</div>
        <div class="list-content">
	        <div class="list-block list-container" style="margin: .5rem;">
						<c:forEach items="${orders}" var="o">
							<div class="item-content">
								<div class="item-inner">
									<div class="col-50 detail">
										<p class="no-margin">订单号： ${o.code}</p>
										<p class="no-margin">下单时间： ${o.createTime}</p>
										<p class="no-margin">订单金额：
											<c:if test="${o.type.arrivepay}">
												${o.currencyCode}: <fmt:formatNumber value="${o.destinationPrice}" minFractionDigits="2"></fmt:formatNumber>
											</c:if>
											<c:if test="${o.type.prepay}">
												<fmt:formatNumber value="${o.cnyPayPrice}" minFractionDigits="2"></fmt:formatNumber>元
											</c:if>
										</p>
									</div>
									<div class="col-50 royalty">
										<c:if test="${not empty o.distributionRewardRecord and o.distributionRewardRecord.status.unconsumed}">
											<i class="iconfont iconfont-lock"></i>
										</c:if>
										<div class="price" style="display: inline-block;vertical-align: middle;text-align: center; margin-left: .25rem;">${o.distributionRewardRecord.amount/100}
											<br><span style="font-size: .6rem;">提成</span>
										</div>
									</div>
								</div>
							</div>
						</c:forEach>
			    </div>
			  </div>
      </div>
    </div>
    
    <div class="panel-overlay"></div>
    <div class="panel panel-right panel-cover fita-panel">
      <div class="list-block contacts-block no-margin">
        <p class="menu-title close-panel">关闭</p>
	      <ul>
	        <li>
	          <a href="${ctx.host}/cars/search" class="item-content item-link">
	            <div class="item-inner">
	              <div class="item-title">立即租车</div>
	            </div>
	          </a>
	        </li>
	        <li>
	          <a href="${ctx.host}/orders" class="item-content item-link">
	            <div class="item-inner">
	              <div class="item-title">我的订单</div>
	            </div>
	          </a>
	        </li>
	      </ul>
      </div>
    </div>
  </div>
  <!-- <a ctx.host="/order/order-staying-list">保留预定</a>
  <a ctx.host="/order/order-unpaid-list">未支付</a>
  <a ctx.host="/order/order-paid-list">已支付</a>
  <a ctx.host="/order/order-finished-list">已完成</a> -->
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/profile/profile-bill.js" />
  <script type="text/javascript">
    require(['page/profile/profile-bill'], function(page) {
      page.init()
    })
  </script>
 
</body>
</html>